5
5
.
.
1
1
8
8
.
.
o
o
v
v
e
e
r
r
l
l
a
a
y
y
I
I
n
n
f
f
o
o
[
[
R
R
]
]
.overlay displays a secondary view in front of the Parent View. It won't affect Parent View in any way.
Which mean that it does opposite from the .background which displays a secondary view behind the Parent View.
Syntax
.overlay(Image("BlueBubble").resizable())
E
E
x
x
a
a
m
m
p
p
l
l
e
e
Example
struct ContentView: View {
var body: some View {
Text("Some text").padding(100).border(Color.red, width: 3)
.overlay(Image("BlueBubble").resizable())
}
}
Output